<template>
  <div>
      <h1>{{this.$store.state.name}}</h1>
      <h1>{{this.$store.state.sex}}</h1>
      <h1>{{newname}}</h1>
     
      <button @click="fun()">点我修改</button>
      <button @click="funa()">点我触发异步操作</button>
  </div>
</template>

<script>
export default {
    computed:{
        newname(){
            return this.$store.state.name
        }
    },
    methods:{
        fun(){
            this.$store.commit("text",{sex:"jjj"})
        },
    }

}
</script>

<style>

</style>